package com.miqtech.master.wyrecorder.entity;

import android.graphics.Bitmap;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * Created by arvin on 2016/11/21.
 */

public class GiftAttachment extends CustomAttachment {
    String giftNum;
    String giftID;
    String giftName;
    String senderName;
    String senderID;
    String giftShowImage;
    Bitmap gitBitmap;

    public Bitmap getGitBitmap() {
        return gitBitmap;
    }

    public void setGitBitmap(Bitmap gitBitmap) {
        this.gitBitmap = gitBitmap;
    }

    public GiftAttachment() {
        super(CustomAttachmentType.GIF);
    }

    @Override
    protected void parseData(JSONObject data) {
        try {
            giftNum = data.getString("giftNum");
            giftID = data.getString("giftID");
            giftName = data.getString("giftName");
            senderName = data.getString("senderName");
            senderID = data.getString("senderID");
            giftShowImage = data.getString("giftShowImage");
        } catch (JSONException e) {
            e.printStackTrace();
        }
    }

    @Override
    protected JSONObject packData() {
        JSONObject data = new JSONObject();
        try {
            data.put("giftNum", giftNum);
            data.put("giftID", giftID);
            data.put("giftName", giftName);
            data.put("senderName", senderName);
            data.put("senderID", senderID);
            data.put("giftShowImage", giftShowImage);
        } catch (JSONException e) {
            e.printStackTrace();
        }
        return data;
    }

    public String getGiftNum() {
        return giftNum;
    }

    public void setGiftNum(String giftNum) {
        this.giftNum = giftNum;
    }

    public String getGiftID() {
        return giftID;
    }

    public void setGiftID(String giftID) {
        this.giftID = giftID;
    }

    public String getGiftName() {
        return giftName;
    }

    public void setGiftName(String giftName) {
        this.giftName = giftName;
    }

    public String getSenderName() {
        return senderName;
    }

    public void setSenderName(String senderName) {
        this.senderName = senderName;
    }

    public String getSenderID() {
        return senderID;
    }

    public void setSenderID(String senderID) {
        this.senderID = senderID;
    }

    public String getGiftShowImage() {
        return giftShowImage;
    }

    public void setGiftShowImage(String giftShowImage) {
        this.giftShowImage = giftShowImage;
    }
}